package top.kaoshanji.q1ch05a.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import top.kaoshanji.q1ch05a.web.WebConfig;

/**
 * 代码清单-q1ch05a-138页a：配置DispatcherServlet
 * @author kaoshanji
 * ^_^
 * create time 2025/4/23 19:59
 */
public class SpitterWebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[] {RootConfig.class};
    }

    // 指定配置类
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] {WebConfig.class};
    }

    // 将 DispatcherServlet 映射到 "/"
    @Override
    protected String[] getServletMappings() {
        return new String[] {"/"} ;
    }

}
